/*
** check_syntax_line.c for asm in /home/vanet_c//proj-kw/asm
** 
** Made by charles-edouard vanet
** Login   <vanet_c@epitech.net>
** 
** Started on  Tue Dec 11 16:33:59 2012 charles-edouard vanet
** Last update Sat Dec 15 19:58:32 2012 charles-edouard vanet
*/

#include	"../includes/asm.h"

int		check_syntax_line(t_list **file_list)
{
  t_my_file	*file;
  int		(*tabfunc[])(t_list **list, t_my_file **my_file) = {
    &syntax_error, &indirection_too_far,
    &label_undefine, &label_syntax, &direct_too_big, NULL};
  int		result;
  int		i;

  result = 0;
  file = (*file_list)->file;
  while (file != NULL)
    {
      i = 0;
      while (tabfunc[i] != NULL)
	{
	  if (i == 0 && file->tab_instruction[0][my_strlen(file->tab_instruction[0]) - 1] == ':')
	    i = 1;
	  result += tabfunc[i](file_list, &file);
	  i++;
	}
      file = file->next;
    }
  return (result);
}
